#pragma once

#include <string>
#include <map>
#include <unordered_map>
#include "base/Define.h"
#include "protocol/routeinfo.pb.h"
#include "protocol/transport.pb.h"
#include <memory>
#include <shared_mutex>
#include "store/RedisStore.h"

namespace zeroplus::mq
{
    enum ServiceType : uint8_t
    {
        PublishService,
        SubscribeService,
        AdministrationService,
        ReceiveService
    };
    class AbstractRequestService;
    class BrokerMediator
    {
    private:
        std::unordered_map<ServiceType, std::shared_ptr<AbstractRequestService>> serviceTable_;

    public:
        BrokerMediator();

        void Notify(const ServiceType &sender, const Bytes &data);

        void AddService(const ServiceType &type, std::shared_ptr<AbstractRequestService> requestService);
    };
}
